#!/bin/bash

SCRIPT_DIR=$(cd `dirname $0` && pwd)
PREFIX=$(pwd)/sysroot
cd $SCRIPT_DIR

rm -rf ./_install
rm -rf ./sysroot
rm -rf ./openssl*

#git reset --hard || exit 1

wget https://www.openssl.org/source/openssl-1.1.1q.tar.gz
tar zxf openssl-1.1.1q.tar.gz
pushd openssl-1.1.1q
./Configure linux-generic32 shared -DL_ENDIAN --prefix=${PREFIX} --openssldir=${PREFIX} shared
make CROSS_COMPILE=arm-hisiv300-linux- LD=arm-hisiv300-linux-ld AR=arm-hisiv300-linux-ar NM=arm-hisiv300-linux-nm AS=arm-hisiv300-linux-as install

popd
